package org.lambda.function;

import java.util.function.Function;

public class FunctionDemo {

    public static void main(String[] args) {
        /* T：入参类型，R：出参类型 */
        Function<Integer, Integer> func = p -> p * 10;

        System.out.println(func.apply(100));

        Function<Integer, Integer> func1 = i -> i + 5;
        System.out.println(func.compose(func1).apply(1));
        System.out.println(func.andThen(func1).apply(1));
    }
}
